﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CodeFarmer.Model.Entities;
using CodeFarmer.DataAccess.Infrastructure;
using CodeFarmer.DataAccess;

namespace CodeFarmer.Service
{
    public interface IArticleService
    {
        Article GetArticle(int id);
    }

    public class ArticleService :IArticleService
    {
        private readonly IUnitOfWork unitOfWork;
        private readonly IArticleRepository articleRepository;

        public ArticleService(IUnitOfWork unitOfWork, IArticleRepository articleRepository)
        {
            this.unitOfWork = unitOfWork;
            this.articleRepository = articleRepository;
        }

        public Article GetArticle(int id)
        {
            return articleRepository.GetById(id);
        }
    }
}
